﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;

using WCFMINERP.InnerFactoryContracts.DataContracts;
using WCFMINERP.InnerFactoryContracts.InterFaces;
using Properties = PrintShopBill.Properties;

namespace WCFMINERP.PrintShopBill.Presenter
{
    public class LoginPresenter
    {
        ChannelFactory<IInnerFactory> _proxy;
        IInnerFactory _innerFactory;

        public LoginPresenter()
        {
            _proxy = new ChannelFactory<IInnerFactory>("IInnerFactory");
            _innerFactory = _proxy.CreateChannel();
        }

        /// <summary>
        /// 用户验证
        /// </summary>
        /// <param name="loginName"></param>
        /// <param name="Loginpwd"></param>
        /// <returns></returns>
        public UserInfo Login(string loginName, string Loginpwd)
        {
            return _innerFactory.UserLogin(loginName, Loginpwd);
        }


        /// <summary>
        /// 获根据techtype取节点Id
        /// </summary>
        /// <returns></returns>
        public int GetTechId()
        {
            return _innerFactory.GettechId(Properties.Settings.Default.fenduiTechType);
        }
    }
}
